1. Field of the Invention
Embodiments of the present invention relate, in general, to reducing latency experienced in computer logging operations and particularly to reducing rotational latency in log writes.
2. Relevant Background
Durability is a common requirement for all transactional data management systems such as databases or file systems. Durability means that the result (state) of a transaction survives failures and has transactional update semantics (atomicity and consistency). Durable memory is contrasted with volatile memory, which is reset at system restart, and persistent memory, which is not volatile but not necessarily having transactional update semantics. For example, magnetic disk memory is persistent and when combined with a transactional data management software it becomes durable.
In any transactional data management system, when an application requests the system to commit a transaction, all the changes introduced by the transaction have to be made durable, that is they have to be stored in persistent memory (storage). Magnetic disk memory (storage) has a long access time that reflects seek time associated with the platter rotation and movement of the actuator arm to reach a given disk location. In order to lower the time it takes to force all the changes to be written into persistent memory (storage) during a commit operations, most transactional systems use the logging technique. In logging, all changes introduced by a transaction are combined into a single record and appended to a sequential log without any unnecessary seek time. Log information is accessed only during a restart after a crash. Otherwise such log information is later discarded. Typically, this technique allows the transactional system to defer updates to the actual persistent copy of the database or file system data, and to perform such updates in a more optimized way.
Typically, rotating disk memories include one or more disks driven about a spindle axis at approximately, between 5,400 and 15,000 revolutions per minute, or one revolution between every 4 and 11 milliseconds. Each disk has a plurality of concentric tracks, on one or both surfaces from which information is written by a write element. In addition, each track is further divided into a plurality of sectors. A track cylinder is formed by the radially corresponding tracks on the disk memories. In a disk drive system, a disk rotates at a high speed while the read/write element “flies” over the surface of the rotating disk. The write element is positioned over specific areas or sectors of the disk in accordance with commands received from the host computer. It is assumed for purposes of the present application that the read/write element is positioned over the correct track. Thus seek time, the transverse positioning of the read/write element, is not a factor in this application. This application is primarily concerned with the amount of time the disk drive spends waiting for the appropriate position of the disk to rotate under the write element.
Each log entry placed into the log requires processing time by the server. One aspect of this processing time is rotational latency or latency as the result of spinning media. While forms of solid state storage mediums exist, the most common form of storage media is a rotational disk drive. Also called rotational delay, rotational latency is the amount of time it takes for the desired sector of a disk (i.e., the sector from which data is to be read or written) to rotate under the read/write element of the disk drive. The average rotational latency for a disk is half the amount of time it takes for the disk to make one revolution. The term typically is applied to rotating storage devices, such as hard disk drives and floppy drives (and even older magnetic drum systems), but not to tape drives.
Log writes are particularly sensitive to rotational latency. Despite increasing disk drive bandwidth, the average rotational latency in modern enterprise disk drives remains in order of 2 milliseconds. This latency period limits the number of log writes that a file system or database can perform to between 250-400 writes per second. While nonvolatile random access memory (flash) represents a solution to this problem by eliminating mechanical moving parts in the drive entirely, this approach requires special hardware and capital outlay. Disk drives remain the primary storage medium. Typical logging combines requests for a short period of time and writes them off to the disk. On average the writing element of the disk will have to wait for one half of a rotation to arrive at the location on the disk to begin writing, about 2 milliseconds. During this period, the application is idle for it is waiting for a confirmation that the write has occurred due to rotational latency. Thus minimizing rotational latency has broad applicability.
From an application perspective log writes introduce a delay in transaction commit operations. In many cases an application has to stall (remain idle) until the transactional system completes the commit operation, that is until the log write operation finishes. With modern enterprise disk drives an average log write delay, that is time required by a sequential append is about 2 milliseconds (half of a the revolution time), which corresponds to about 2 to 6 million processor cycles. While disk performance is advancing the gap between disk and processor performance increases.